import { CHANGE_POST_IMAGE_LIST } from './../mutation.types'

const sendPost = {
  namespaced: true,
  state: {
    post_image_list: []
  },
  actions: {
    uploadImg ({ commit }, params) {
      commit({
        type: CHANGE_POST_IMAGE_LIST,
        payload: [...params.imgList]
      })
    }
  },
  mutations: {
    [CHANGE_POST_IMAGE_LIST] (state, data) {
      // state.post_image_list = data.payload
      state.post_image_list = [...data.payload]
    }
  }
}

export default sendPost
